<!DOCTYPE html>
<html lang="id">
<head>
	<title><?php echo PROJECT_NAME; ?></title>
	<meta charset="utf-8">
	<meta content='id' http-equiv='Content-Language'/>
	<meta content='<?php echo PROJECT_NAME; ?>' name='description'/>
	<meta content='INDEX,NOFOLLOW' name='robots'/>
	<meta content='Sistem Monitoring Anggaran' name='keywords'/>
	<meta content='1 days' name='revisit-after'/>
	<meta content='1 days' name='revisit'/>
	<link href='#' rel='shortcut icon'/>
	
	<?php
		// ASSETS //;
		echo css_asset('style.css');
		
		/* theme */
		// echo css_asset('default.css','theme/thegreenhouse');
		echo css_asset('style.css','theme/login');
	?>
	<!-- assets -->
	<?php  echo js_asset("jquery-1.9.1.js","jquery-ui-1.10.3.custom"); ?>
	
	<script>
	function login_process(){
		var l_username = $(".l_username").val();
		var l_password = $(".l_password").val();
		$.ajax({
			url :"<?php echo base_url('c_login/process')?>",
			type:"POST",
			dataType:"JSON",
			data:{
					l_username:l_username,
					l_password:l_password
				 },
			success:function(response){
				// console.log(response);
				if(response.message == "true"){
					window.location = "<?php echo base_url()?>"
				} else {
					alert_error.show("slow");
				}
			}
		});
	}

	$(document).ready(function(){
		alert_error = $(".error");
		alert_error.hide();
		
		$(".l_username").keypress(function(e){
			if(e.keyCode == 13){
				$("#l_password").focus();
			}
		});
		
		$(".l_password").keypress(function(e){
			if(e.keyCode == 13){
				login_process();
			}
		});
		
		$("#submit").click(function(){
			login_process();
		});
	});	
	</script>
</head>
<style>
.error{
	text-align:center;
	font-weight : bold;
	color : #e00;
}
</style>
<body>
  	<div id="wrapper">
		  <p class="error">Username dan password anda salah!</p> 
		<div id="wrappertop"></div>

		<div id="wrappermiddle">

			<h2>Login</h2>
  
			<div id="username_input">

				<div id="username_inputleft"></div>

				<div id="username_inputmiddle">
					<input type="text" class="l_username" name="link" id="url" value="Username" onclick="this.value = ''">
					<img id="url_user" src="../assets/modules/theme/login/images/mailicon.png" alt="">
				</div>

				<div id="username_inputright"></div>

			</div>

			<div id="password_input">

				<div id="password_inputleft"></div>

				<div id="password_inputmiddle">
					<input type="password" class="l_password"  name="link" id="url" value="Password" onclick="this.value = ''">
					<img id="url_password" src="../assets/modules/theme/login/images/passicon.png" alt="">
				</div>

				<div id="password_inputright"></div>

			</div>

			<div id="submit">
				<input type="image" src="../assets/modules/theme/login/images/submit_hover.png" id="submit1" value="Sign In">
				<input type="image" src="../assets/modules/theme/login/images/submit.png" id="submit2" value="Sign In">

			</div>

		</div>

		<div id="wrapperbottom"></div>
		
		<div id="powered">
		<p><?php echo PROJECT_NAME; ?></p>
		</div>
	</div>
	
	<!-- div>
		<h1><?php echo PROJECT_NAME; ?></h1>
		<div id="login">
		  <p class="error">Username dan password anda salah!</p>        
		  <div>
			<p>
			  <label><strong>Username</strong>
					<input type="text" name="textfield" class="inputText" id="l_username" />
			  </label>
		  </p>
			<p>
			  <label><strong>Password</strong>
				<input type="password" name="textfield2" class="inputText" id="l_password" />
			</label>
			</p>
			<a class="black_button" href="javascript:login_process()" ><span>Login</span></a>          
		  </div>
		  <br clear="all" />
		</div>
	</div -->

</body>
</html>
